<!--
 * @Descripttion: 自定义渲染组件 通过render进行设置
 * @version: 0.0.0.1
 * @Author: chenyf15482
 * @Date: 2022-12-08 16:14:21
 * @LastEditors: chenyf15482
 * @LastEditTime: 2023-01-30 15:30:39
-->
<!-- 样例
const test = [
  { content: 'test',
    props: { timestamp: '2018/4/2' },
    render: (h: yAny, params: yAny) => {
      return h(ElCard, {}, { default: () => params.content})
    } 
  },
]
-->
<script lang="ts">
import { defineComponent, h } from 'vue'

export default defineComponent({
  name: 'YfRender',
  props: {
    params: {
      type: Object,
      default: () => { return {} }
    },
    toRender: {
      type: Function,
      default: () => ''
    }
  },
  render() {
    // toRender为回调函数 用于函数式组件渲染
    // params为单元格参数数据
    return this.toRender(h, this.params);
  }
})
</script>